package com.daatak.customer.business;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.daatak.customer.dao.CustomerDaoI;
import com.daatak.customer.domain.CustomerAddress;
import com.daatak.customer.domain.CustomerObject;

@Service
@Transactional
public class CustomerBean implements CustomerBeanI {
	
	@Autowired
	CustomerDaoI customerDao;
	
	public List<CustomerObject> list()
	{
		return customerDao.list();
	}
	
	public void create(CustomerObject userPojo)
	{
		customerDao.create(userPojo);
		
	}
	
	public CustomerObject findById(Integer Id)
	{
		CustomerObject user = customerDao.findById(Id);
		return customerDao.findById(Id);
	}
	
	public void delete(CustomerObject  userPojo)
	{
		customerDao.delete(userPojo);
	}

	public void setUserDao(CustomerDaoI userDao) {
		this.customerDao = userDao;
	}

	public CustomerObject loadUserByUsername(String arg0) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<CustomerAddress> geCustomerAddress(Integer customerId)
	{
		//UserObject user = userDao.getUserAddress(userId);
		
		return customerDao.geCustomerAddress(customerId);
	}

	
	
}
